package cn.wanda.bi.sunshine.platform.server.bean.enums;

/**
 * Created by wangfupeng1 on 2017-4-8.
 */
public enum ChannelStatus {

    DELETE(-3, "删除"),
    //异常
    ERROR(0, "异常"),
    //正常
    OK(1, "正常");

    private Integer key;
    private String value;

    ChannelStatus(Integer key, String value) {
        this.key = key;
        this.value = value;
    }

    public Byte byteKey() {
        return key.byteValue();
    }

    public Integer key() {
        return key;
    }

    public String value() {
        return value;
    }

    public static String value(int key) {
        if (key == DELETE.key)
            return DELETE.value;
        if (key == ERROR.key)
            return ERROR.value;
        if (key == OK.key)
            return OK.value;

        return OK.value;
    }
}
